//
//  HBIncomeCtrl.m
//  HuoBao
//
//  Created by sky on 15/12/2.
//  Copyright © 2015年 jinxin. All rights reserved.
//

#import "HBIncomeCtrl.h"
#import "HBIncomeDetailCtrl.h"
#import "HBExpofGoldCtrl.h"
#import "HBBondListCtrl.h"
#import "HBWithdrawCtrl.h"
#import "HBInvestCtrl.h"
#import "HBGetUserStatusManager.h"
#import "HBIdentifierCheckCtrl.h"
#import "HBAddBankCtrl.h"
#import "RecordViewCtrl.h"
#import "HBCompleteBankInfoCtrl.h"
#import "HBGetIncomeSummaryInfo.h"
#import "HBGetIncomeSummaryParam.h"
#import "HBGetIncomeSummaryParser.h"
#import "NetCenter.h"
#import "HBLoginManager.h"
#import "HBInvestManager.h"
#import "HBUserDistillParam.h"
#import "HBUserDistillParser.h"
#import "HBUserDistillInfo.h"

#import "HBAddBankCtrl.h"
#import "HBWithdrawCtrl.h"
#import "CustomNoBandBankAlert.h"
#import "CustomNoTradingPwdAlert.h"
#import "CustomerTestView.h"
#import "HBSetTradpasswordCtrl.h"


#define GetFinalResult(x,y,z,r) (IsIphone4?x:(IsIphone6P?r:(IsIphone5?y:z)))

#define BTNTOTOP       GetFinalResult(160/2,160/2,280/2,280/2)

@interface HBIncomeCtrl (){
    UIScrollView *_bgview;
    UILabel *_incomelbl;
    UILabel *_allincomelbl;
    UILabel *_yearrate;
    UILabel *_addrate;
    UILabel *_property;
    UILabel *_expmoney;
}

@property (strong , nonatomic)HBGetIncomeSummaryInfo *iteminfo;

@end

@implementation HBIncomeCtrl

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}


-(void)buildLayout{
    _bgview = [[UIScrollView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)];
    _bgview.backgroundColor = [UIColor clearColor];
    [self.view addSubview:_bgview];
    
//    [self requestTogetIncomeSummary];
    
    _incomelbl = [self LabelWithRect:CGRectMake(0, 45, SCREEN_WIDTH, 40) textColor:[LCCommon getColor:@"fa9838"] textstr:@"" textfont:40 textstyle:NSTextAlignmentCenter];
    [_bgview addSubview:_incomelbl];
    
    UIImage *shouyi = [UIImage imageNamed:@"income_shouyi"];
    NSString *str = @"昨日收益(元)";
    CGSize incomesize = [str sizeWithAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:15]}];
    
//    NSRange rangeyi = [str rangeOfString:@"益"];//匹配得到的下标
//    NSRange rangeyu = [str rangeOfString:@"元"];
    
    _allincomelbl = [self LabelWithRect:CGRectMake(SCREEN_WIDTH/2 - (incomesize.width + shouyi.size.width + 5)/2 , 45 + 40 + 33/2 - 15, incomesize.width, 30) textColor:[LCCommon getColor:@"b1b1b1"] textstr:str textfont:15 textstyle:NSTextAlignmentCenter];
    _allincomelbl.userInteractionEnabled = YES;
    [_bgview addSubview:_allincomelbl];
    
//    NSMutableAttributedString *noteStr = [[NSMutableAttributedString alloc] initWithString:_allincomelbl.text];
//    [noteStr addAttribute:NSForegroundColorAttributeName value:[LCCommon getColor:@"f34546"] range:NSMakeRange(rangeyi.location + 1, rangeyu.location - rangeyi.location - 1)];
//    [_allincomelbl setAttributedText:noteStr] ;
    
    
    UIImageView *shoyivi = [[UIImageView alloc]initWithFrame:CGRectMake(_allincomelbl.origin.x + _allincomelbl.size.width + 5, _allincomelbl.origin.y + 2 + 8, shouyi.size.width, shouyi.size.height)];
    shoyivi.userInteractionEnabled = YES;
    shoyivi.image = shouyi;
    [_bgview addSubview:shoyivi];
    
    
    UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(tapToShouYi)];
    UITapGestureRecognizer *tap2 = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(tapToShouYi)];
    [_allincomelbl addGestureRecognizer:tap];
    [shoyivi addGestureRecognizer:tap2];
    
    

    _yearrate = [self LabelWithRect:CGRectMake(0, _allincomelbl.origin.y + 15 + 76/2, SCREEN_WIDTH/2, 19) textColor:[LCCommon getColor:@"999999"] textstr:@"" textfont:19 textstyle:NSTextAlignmentCenter];
    [_bgview addSubview:_yearrate];
    
    
    _addrate = [self LabelWithRect:CGRectMake(SCREEN_WIDTH/2, _yearrate.origin.y, SCREEN_WIDTH/2, 19) textColor:[LCCommon getColor:@"999999"] textstr:@"" textfont:19 textstyle:NSTextAlignmentCenter];
    [_bgview addSubview:_addrate];
    
    
    UILabel *nianhua = [self LabelWithRect:CGRectMake(0, _yearrate.origin.y + 19 + 12, SCREEN_WIDTH/2, 14) textColor:[LCCommon getColor:@"b1b1b1"] textstr:@"累计收益" textfont:14 textstyle:NSTextAlignmentCenter];
    [_bgview addSubview:nianhua];
    
    
    UILabel *jiaxi = [self LabelWithRect:CGRectMake(SCREEN_WIDTH/2, nianhua.origin.y, SCREEN_WIDTH/2, 14) textColor:[LCCommon getColor:@"b1b1b1"] textstr:@"奖励加息" textfont:14 textstyle:NSTextAlignmentCenter];
    [_bgview addSubview:jiaxi];
    
    
    UIView *line = [self makeLinewithRect:CGRectMake(15, nianhua.origin.y + 12 + 64/2, SCREEN_WIDTH - 30, .5) Color:[LCCommon getColor:@"585858"] addview:_bgview];
    
    [self makeLinewithRect:CGRectMake(15, line.origin.y + 180/2, SCREEN_WIDTH- 30 , .5) Color:[LCCommon getColor:@"585858"] addview:_bgview];
    
    [self makeLinewithRect:CGRectMake(SCREEN_WIDTH/2, line.origin.y, .5, 180/2) Color:[LCCommon getColor:@"585858"] addview:_bgview];
    

    UIButton *zichanBtn = [[UIButton alloc]initWithFrame:CGRectMake(15, line.origin.y, SCREEN_WIDTH/2 - 15, 180/2)];
    zichanBtn.backgroundColor = [UIColor clearColor];
    [zichanBtn addTarget:self action:@selector(zichanPress) forControlEvents:UIControlEventTouchUpInside];
    [_bgview addSubview:zichanBtn];
    
    
    UIButton *tiyanBtn = [[UIButton alloc]initWithFrame:CGRectMake(SCREEN_WIDTH/2, line.origin.y, SCREEN_WIDTH/2 - 15, 180/2)];
    tiyanBtn.backgroundColor = [UIColor clearColor];
    [tiyanBtn addTarget:self action:@selector(tiyanPress) forControlEvents:UIControlEventTouchUpInside];
    [_bgview addSubview:tiyanBtn];
    
    
    _property = [self LabelWithRect:CGRectMake(0, line.origin.y + 25, SCREEN_WIDTH/2, 19) textColor:[LCCommon getColor:@"f34546"] textstr:@"" textfont:19 textstyle:NSTextAlignmentCenter];
    [_bgview addSubview:_property];
    
    
    
    _expmoney = [self LabelWithRect:CGRectMake(SCREEN_WIDTH/2, _property.origin.y , SCREEN_WIDTH/2, 19) textColor:[LCCommon getColor:@"f34546"] textstr:@"" textfont:19 textstyle:NSTextAlignmentCenter];
    [_bgview addSubview:_expmoney];
    
    UIImage *jiantou = [UIImage imageNamed:@"income_tiyan_tou"];
    
    NSString *zongstr = @"我的资产(元)";
    NSString *tiyanjin = @"体验金";
    
    CGSize zongsize = [zongstr sizeWithAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:14]}];
    CGSize tisize = [tiyanjin sizeWithAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:14]}];
    
    
    UILabel *zong = [self LabelWithRect:CGRectMake(SCREEN_WIDTH/4 - (zongsize.width + jiantou.size.width + 5)/2, _property.origin.y + 19 + 7, zongsize.width, 14) textColor:[LCCommon getColor:@"b1b1b1"] textstr:zongstr textfont:14 textstyle:NSTextAlignmentCenter];
    [_bgview addSubview:zong];
    
    UIImageView *zji = [[UIImageView alloc]initWithFrame:CGRectMake(zong.origin.x + zongsize.width + 5, zong.origin.y + 2, jiantou.size.width, jiantou.size.height)];
    zji.image = jiantou;
    [_bgview addSubview:zji];
    
    UILabel *tiyan = [self LabelWithRect:CGRectMake(3 * SCREEN_WIDTH/4 - (tisize.width + jiantou.size.width + 5)/2, zong.origin.y, tisize.width, 14) textColor:[LCCommon getColor:@"b1b1b1"] textstr:tiyanjin textfont:14 textstyle:NSTextAlignmentCenter];
    [_bgview addSubview:tiyan];
    
    UIImageView *tji = [[UIImageView alloc]initWithFrame:CGRectMake(tiyan.origin.x + tisize.width + 5, zong.origin.y + 2, jiantou.size.width, jiantou.size.height)];
    tji.image = jiantou;
    [_bgview addSubview:tji];
    
    
//    UIView *zhaivi = [[UIView alloc]initWithFrame:CGRectMake(15, line.origin.y + 146/2 + 32/2, SCREEN_WIDTH - 30, 86/2)];
//    zhaivi.backgroundColor = [LCCommon getColor:@"37383d"];
//    zhaivi.userInteractionEnabled = YES;
//    [_bgview addSubview:zhaivi];
//    
//    UITapGestureRecognizer *taptozhai = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(tapToZhaiQ)];
//    [zhaivi addGestureRecognizer:taptozhai];
//    
//    
//    UILabel *zhaiquan = [self LabelWithRect:CGRectMake(14, 86/4 - 16/2, 4 * 16, 16) textColor:[LCCommon getColor:@"b1b1b1"] textstr:@"债券列表" textfont:16 textstyle:NSTextAlignmentLeft];
//    [zhaivi addSubview:zhaiquan];
//    
//    
//    UIImage *zhantou = [UIImage imageNamed:@"income_zhaiquan"];
//    UIImageView *zhaiwroo = [[UIImageView alloc]initWithFrame:CGRectMake(zhaivi.size.width - 14 - zhantou.size.width,  86/4 - zhantou.size.height/2, zhantou.size.width, zhantou.size.height)];
//    zhaiwroo.image = zhantou;
//    [zhaivi addSubview:zhaiwroo];
    
    
    UIButton *bugBtn = [[UIButton alloc]initWithFrame:CGRectMake(15, line.origin.y + 180/2 + BTNTOTOP, SCREEN_WIDTH/2 - 30, 45)];
    [bugBtn setTitle:@"购 买" forState:UIControlStateNormal];
    bugBtn.titleLabel.font = [UIFont systemFontOfSize:18];
    [bugBtn setBackgroundColor:[LCCommon getColor:@"f34546"] forState:UIControlStateNormal];
    [bugBtn setBackgroundColor:[LCCommon getColor:@"d43333"] forState:UIControlStateHighlighted];
    [bugBtn addTarget:self action:@selector(pressToBuy) forControlEvents:UIControlEventTouchUpInside];
    bugBtn.clipsToBounds = YES;
    bugBtn.layer.cornerRadius = 4;
    [_bgview addSubview:bugBtn];
    
    
    UIButton *depo = [[UIButton alloc]initWithFrame:CGRectMake(SCREEN_WIDTH/2 + 15, bugBtn.origin.y, SCREEN_WIDTH/2 - 30, 45)];
    [depo setTitle:@"提 现" forState:UIControlStateNormal];
    depo.titleLabel.font = [UIFont systemFontOfSize:18];
    [depo setBackgroundColor:[LCCommon getColor:@"fa9838"] forState:UIControlStateNormal];
    [depo setBackgroundColor:[LCCommon getColor:@"e47910"] forState:UIControlStateHighlighted];
    [depo addTarget:self action:@selector(pressToDepo) forControlEvents:UIControlEventTouchUpInside];
    depo.clipsToBounds = YES;
    depo.layer.cornerRadius = 4;
    [_bgview addSubview:depo];
    
    _bgview.contentSize = CGSizeMake(SCREEN_WIDTH, (bugBtn.origin.y) + 45 + 30 + 64 + TABBAR_HEIGHT);
    
    __weak UIScrollView *tableView = _bgview;
    __weak typeof(self) weakSelf = self;
    
    // 下拉刷新
    tableView.mj_header = [HBOrangeHeader headerWithRefreshingBlock:^{
        
        [weakSelf requestTogetIncomeSummary];
        
        //        // 模拟延迟加载数据，因此2秒后才调用（真实开发中，可以移除这段gcd代码）
        //        dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        //            // 结束刷新
        //            [tableView.mj_header endRefreshing];
        //        });
    }];
    
//    [_bgview.mj_header beginRefreshing];
    [self requestTogetIncomeSummary];

}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


-(UILabel *)LabelWithRect:(CGRect)rect textColor:(UIColor *)color textstr:(NSString *)str textfont:(int)font textstyle:(NSTextAlignment)aligment{
    UILabel *label = [[UILabel alloc] initWithFrame:rect];
    label.textColor = color;
    label.text = str;
    label.font = [UIFont systemFontOfSize:font];
    label.textAlignment = aligment;
    label.numberOfLines = 0;
    return label;
}

-(UIView *)makeLinewithRect:(CGRect)rect Color:(UIColor *)color addview:(UIView *)vi{
    UIView *line = [[UIView alloc]initWithFrame:rect];
    line.backgroundColor = color;
    [vi addSubview:line];
    return line;
}


-(void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(requestTogetIncomeSummary) name:@"upIncomeData"  object:nil];
}

#pragma mark - tapToShouYi

-(void)tapToShouYi{
    LLog(@"tapToShouYi");
    HBIncomeDetailCtrl *detailCtrl = [[HBIncomeDetailCtrl alloc]init];
    [self.navigationController pushViewController:detailCtrl animated:YES];
}

//#pragma mark - tapToZhaiQ
//
//-(void)tapToZhaiQ{
//    LLog(@"tapToZhaiQ");
//    HBBondListCtrl *bondListCtrl = [[HBBondListCtrl alloc]init];
//    [self.navigationController pushViewController:bondListCtrl animated:YES];
//}

#pragma mark - pressToBuy

-(void)pressToBuy{
    
//    [CustomLoadingView showHudToView:nil];
    [CustomLoadingView hideHudForView:self.view];
    [CustomLoadingView showHudToView:[UIApplication sharedApplication].keyWindow];
    [HBInvestManager requestToGetUserInvestLimitWithResult:^(BOOL isSuccess, NSString *msg, NSError *error) {
//        [CustomLoadingView hideHudForView:nil];
        [CustomLoadingView hideHudForView:[UIApplication sharedApplication].keyWindow];
        if (isSuccess)
        {
//            HBInvestCtrl *investCtrl = [[HBInvestCtrl alloc]init];
//            [self.navigationController pushViewController:investCtrl animated:YES];
            
            if ([[HBInvestManager sharedHBInvestManager].userInvestLimitInfo.bindCardStatus integerValue])
            {
                HBInvestCtrl *investCtrl = [[HBInvestCtrl alloc]init];
                [self.navigationController pushViewController:investCtrl animated:YES];
            }
            else
            {
                HBAddBankCtrl *checkCtrl = [[HBAddBankCtrl alloc]init];
                checkCtrl.viewpageJumpingFrom = isFromInvestView;
                checkCtrl.isRealName = [[HBInvestManager sharedHBInvestManager].userInvestLimitInfo.identityStatus integerValue];
                //                checkCtrl.investMoney = self.moneyTF.text;
                //                checkCtrl.userInvestInfo = userInvestInfo;
                [self.navigationController pushViewController:checkCtrl animated:YES];
            }

        }
        else
        {
            DISSMISS_ERR(error?[error description]:msg);
        }
    }];
    
    /*
    if ([HBGetUserStatusManager sharedHBGetUserStatusManager].isAllAuthor)
    {
        HBInvestCtrl *investCtrl = [[HBInvestCtrl alloc]init];
        [self.navigationController pushViewController:investCtrl animated:YES];
    }
    else
    {
        [CustomLoadingView showHudToView:nil];
        [HBGetUserStatusManager requestToGetUserStatusWithResult:^(BOOL isSuccess, NSString *msg, NSError *error) {
            if ([HBGetUserStatusManager sharedHBGetUserStatusManager].isAllAuthor)
            {
                HBInvestCtrl *investCtrl = [[HBInvestCtrl alloc]init];
                [self.navigationController pushViewController:investCtrl animated:YES];
            }
            else
            {
                if (![[HBGetUserStatusManager sharedHBGetUserStatusManager].userStatusInfo.identityStatus integerValue])
                {
                    HBIdentifierCheckCtrl *checkCtrl = [[HBIdentifierCheckCtrl alloc]init];
                    [self.navigationController pushViewController:checkCtrl animated:YES];
                }
                else
                {
                    HBAddBankCtrl *bankCtrl = [[HBAddBankCtrl alloc]initWithNibName:NSStringFromClass([HBAddBankCtrl class]) bundle:nil];
                    [self.navigationController pushViewController:bankCtrl animated:YES];
                }
            }
            [CustomLoadingView hideHudForView:nil];
        }];
    }
     */

}

#pragma mark - pressToDepo

-(void)pressToDepo{
//    HBCompleteBankInfoCtrl *draw = [[HBCompleteBankInfoCtrl alloc]init];
//    [self.navigationController pushViewController:draw animated:YES];
    
//    [CustomLoadingView showHudToView:nil];
    [CustomLoadingView hideHudForView:self.view];
    [CustomLoadingView showHudToView:[UIApplication sharedApplication].keyWindow];
    HBUserDistillParam *param = [[HBUserDistillParam alloc]init];
    param.token = [HBLoginManager sharedHBLoginManager].currentUserInfo.token;
    param.uid = [HBLoginManager sharedHBLoginManager].currentUserInfo.uid;
    HBUserDistillParser *parser = [[HBUserDistillParser alloc]init];
    [NetCenter postDataFromURL:Method_userDistill params:param parser:parser result:^(ParserResult *myResult) {
//        [CustomLoadingView hideHudForView:nil];
        [CustomLoadingView hideHudForView:[UIApplication sharedApplication].keyWindow];
        if (myResult.code == 0)
        {
            HBUserDistillInfo *info = (HBUserDistillInfo *)myResult.result;
            if (![info.bindCardStatus integerValue])
            {
                CustomNoBandBankAlert *alert = [[CustomNoBandBankAlert alloc]init];
                if([self.tabBarController selectedIndex]==1)
                {
                    [alert showTradPasswordAlertView];
                }
                
                alert.ActionClickToBindBank = ^(CustomNoBandBankAlert *aAlert)
                {
                    [aAlert removeFromSuperview];
                    HBAddBankCtrl *addBankCtrl = [[HBAddBankCtrl alloc]initWithNibName:NSStringFromClass([HBAddBankCtrl class]) bundle:nil];
                    addBankCtrl.viewpageJumpingFrom = isFromBankView;
                    addBankCtrl.isRealName = [info.identityStatus integerValue];
                    [self.navigationController pushViewController:addBankCtrl animated:YES];
                };
                
            }
//            else if ([info.distillMaxMoney integerValue]==0)
//            {
//                [[[CustomerTestView alloc]initWithContent:@"今天剩余体现次数为0" TrueOrnot:NO] showInView];
//            }
            else if(![info.accountBankStatus  integerValue])
            {
                HBCompleteBankInfoCtrl *draw = [[HBCompleteBankInfoCtrl alloc]init];
                draw.userDistillInfo = info;
                [self.navigationController pushViewController:draw animated:YES];
            }
            else if(![info.tradingPwdStatus integerValue])
            {
                CustomNoTradingPwdAlert *alert = [[CustomNoTradingPwdAlert alloc]init];
                if([self.tabBarController selectedIndex]==1)
                {
                     [alert showTradPasswordAlertView];
                }
               
                alert.ActionClickToSetTradingPwd = ^(CustomNoTradingPwdAlert *alertP)
                {
                    [alertP removeFromSuperview];
                    HBSetTradpasswordCtrl *addBankCtrl = [[HBSetTradpasswordCtrl alloc]initWithNibName:NSStringFromClass([HBSetTradpasswordCtrl class]) bundle:nil];
                    addBankCtrl.isFromTiXian = YES;
                    [self.navigationController pushViewController:addBankCtrl animated:YES];
                };
            }
            else
            {
                HBWithdrawCtrl *expofCtrl = [[HBWithdrawCtrl alloc]init];
                expofCtrl.userDistillInfo = info;
                [self.navigationController pushViewController:expofCtrl animated:YES];
            }
        }
        else
        {
            DISSMISS_ERR(myResult.message);
        }
        
    } failure:^(NSError *error) {
//        [CustomLoadingView hideHudForView:nil];
        [CustomLoadingView hideHudForView:[UIApplication sharedApplication].keyWindow];
        DISSMISS_ERR([error description]);
    }];
    
}


#pragma mark - zichanPress

-(void)zichanPress{
    LLog(@"zichanPress");
    RecordViewCtrl* recordVC = [[RecordViewCtrl alloc] init];
    [self.navigationController pushViewController:recordVC animated:YES];
}


#pragma mark - tiyanPress

-(void)tiyanPress{
    LLog(@"tiyanPress");
    HBExpofGoldCtrl *exp = [[HBExpofGoldCtrl alloc]init];
    [self.navigationController pushViewController:exp animated:YES];
}


#pragma mark - requestToIncome

-(void)requestTogetIncomeSummary{
    HBGetIncomeSummaryParam *param = [[HBGetIncomeSummaryParam alloc]init];
    param.token = [HBLoginManager sharedHBLoginManager].currentUserInfo.token;
    param.uid = [HBLoginManager sharedHBLoginManager].currentUserInfo.uid;
//    [CustomLoadingView showHudToView:nil];
    [CustomLoadingView showHudToView:self.view];
    HBGetIncomeSummaryParser *parser = [[HBGetIncomeSummaryParser alloc]init];
    [NetCenter getDataFromURL:Method_getIncomeSummary params:param parser:parser result:^(ParserResult *myResult) {
//        [CustomLoadingView hideHudForView:nil];
        [_bgview.mj_header endRefreshing];
        [CustomLoadingView hideHudForView:self.view];
        if (myResult.code == 0)
        {
            HBGetIncomeSummaryInfo *info = (HBGetIncomeSummaryInfo *)myResult.result;
            self.iteminfo =  info;
            [self makeDataForUI];
        }
        else
        {
            DISSMISS_ERR(myResult.message);
        }

    } failure:^(NSError *error) {
//        [CustomLoadingView hideHudForView:nil];
        [_bgview.mj_header endRefreshing];
        [CustomLoadingView hideHudForView:self.view];
        DISSMISS_ERR([error description]);
    }];
}



-(void)makeDataForUI{
    _incomelbl.text = [NSString stringWithFormat:@"%.2f",[self.iteminfo.yesterdayIncome doubleValue]];
    
    if (self.iteminfo.increaseRate.length == 0 || [self.iteminfo.increaseRate doubleValue] == 0) {
        _addrate.text = [NSString stringWithFormat:@"%.2f",[self.iteminfo.increaseRate floatValue]];
    }else{
        _addrate.text = [NSString stringWithFormat:@"%.1f%%",[self.iteminfo.increaseRate floatValue]*100];
    }
    
    _yearrate.text = [NSString stringWithFormat:@"%.2f",[self.iteminfo.userTotalIncome doubleValue]];
    _property.text = [NSString stringWithFormat:@"%.2f",[self.iteminfo.currentMoney doubleValue]];
    _expmoney.text = [NSString stringWithFormat:@"%.2f",[self.iteminfo.experienceMoney doubleValue]];
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
